qui(
	function(require, exports, module){

        Server.Action = (function() {
			var serverGrid = null;
            var getServerGrid = function(options) {
                if (!serverGrid) {

                    serverGrid = new Server.Grid($.extend(true, {
                        '$container': $('#ServerListContainer'),
                        type: 0
                    }, options));
                }
                return serverGrid;
            };
            var serverGridRun = function(options) {
                serverGrid = getServerGrid(options);
                serverGrid.run();
            };
			var run = function() {
                /* videoQueryRun();*/
                serverGridRun({});
            };
            var editBase = null;
            var getEditBase = function(options) {

                if (!editBase) {
                    editBase = new Server.Edit(options);
                }
                return editBase;
            };
            var editRun = function() {
                var $container = $('.video-edit-form');
                getEditBase({
                    $container: $container
                }).run();
            };

            var versionBase = null;

            var versionRun = function () {
                var $container = $('#VersionListContainer');
                getVersionBase({
                    $container: $container
                }).run();
            }
            var getVersionBase = function(options) {

                if (!versionBase) {
                    versionBase = new Server.Version(options);
                }
                return versionBase;
            };

            var editClusterBase = null;
            var getEditClusterBase = function(options) {

                if (!editClusterBase) {
                    editClusterBase = new Server.ClusterEdit(options);
                }
                return editClusterBase;
            };
            var editClusterBaseRun = function() {
                var $container = $('.video-edit-form');
                getEditClusterBase({
                    $container: $container
                }).run();
            };

            var clusterBase = null;
            var getClusterBase = function(options) {

                if (!clusterBase) {
                    clusterBase = new Server.ClusterList(options);
                }
                return clusterBase;
            };
            var clusterBaseRun = function() {
                var $container = $('#ClusterListContainer');
                getClusterBase({
                    $container: $container
                }).run();
            };

            return {
                run: run,
				editRun:editRun,
				getServerGrid:getServerGrid,
                versionRun:versionRun,
                editClusterBaseRun:editClusterBaseRun,
                clusterBaseRun:clusterBaseRun
            };
        })();
	}
);